ActiveAdmin.register Profile do

    menu :priority => 1

    scope :all, :default => true
    scope :windows_agent
    scope :windows_agentless
    scope :unix_agentless
    scope :database_agentless

    index :download_links => false do
        column :profile
        column :domain
        column :scantype
        column :memory
        column :description

        default_actions
    end

   # -- the form structure
   form do |f|
        f.inputs t("profiles.form.title") do
            f.input :profile, :label => t("profiles.form.profile")
            f.input :scantype, :label => t("profiles.form.scan_type"), 
                    :collection => {  t("profiles.form.scan_type_options.windows_agent") => "win_agent",
                                      t("profiles.form.scan_type_options.windows_agentless") => "win_agentless",
                                      t("profiles.form.scan_type_options.windows_share") => "win_share",
                                      t("profiles.form.scan_type_options.unix_agentless") => "unix_agentless",
                                      t("profiles.form.scan_type_options.mssql_agentless") => "mssql_agentless",
                                      t("profiles.form.scan_type_options.mysql_agentless") => "mysql_agentless",
                                      t("profiles.form.scan_type_options.postgresql_agentless") => "postgresql_agentless" }
            f.input :username, :label => t("profiles.form.username")
            f.input :password, :label => t("profiles.form.password")
            f.input :mask, :label => t("profiles.form.mask")
            f.input :domain, :label => t("profiles.form.domain")
            f.input :dbs, :label => t("profiles.form.databases")
            f.input :tables, :label => t("profiles.form.tables")
            f.input :columns, :label => t("profiles.form.columns")
            f.input :path, :label => t("profiles.form.path")
            f.input :memory, :label => t("profiles.form.memory")
            f.input :dirs, :label => t("profiles.form.dirs")
            f.input :exts, :label => t("profiles.form.exts")
            f.input :regex, :label => t("profiles.form.regexs"), :as => :check_boxes, :collection => Regex.all.collect {|r| [r.name + " : " + r.pattern, r.id]}
            f.input :creditcards, :label => t("profiles.form.creditcards")
            f.input :zipfiles, :label => t("profiles.form.zipfiles")
            f.input :description, :label => t("profiles.form.description")

            f.buttons :submit, :id => "buttons_fieldset"
        end
   end

end
